import { getStore } from '@/util/store'
import { dateFormat } from '@/util/date'
export const option = function () {
  return {
    labelWidth: 120,
    emptyBtn: false,
    submitBtn: false,
    submitText: '下一步',
    detail: ['view'].includes(this.type),
    column: [
      {
        label: '申请编号',
        span: 8,
        prop: 'applyCode',
        maxlength: 100,
        disabled: true
      },
      {
        label: '申请人',
        span: 8,
        prop: 'applicant',
        maxlength: 100,
        disabled: true,
        value: getStore({ name: 'userInfo' }).user_name
      },
      {
        label: '申请时间',
        span: 8,
        prop: 'applyDate',
        type: 'date',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd',
        maxlength: 100,
        disabled: true,
        value: dateFormat(new Date())
      },
      {
        label: '供应商名称',
        span: 8,
        prop: 'supplierName',
        formslot: true,
        rules: [
          {
            required: true,
            message: '请输入供应商名称',
            trigger: 'change'
          }
        ]
      },
      {
        label: '原因说明',
        prop: 'reasonExplain',
        type: 'textarea',
        maxlength: 500,
        minRows: 4,
        maxRows: 5,
        span: 24
      },
      {
        label: '附件',
        prop: 'attachment',
        formslot: true,
        span: 24
      }
    ]
  }
}

export const supplierOption = [
  { label: '选择', prop: 'radio', width: 50 },
  { label: '供应商编码', prop: 'supplierCode' },
  { label: '供应商名称', prop: 'supplierName' },
  { label: '供应商类型', prop: 'supplierCategory' },
  { label: '供应商身份', prop: 'supplierIdentity' },
]